package com.fintech.third.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.fintech.third.model.message.MessageInfoPageConditionDto;
import com.fintech.third.model.message.PushMessageInfo;

public interface PushMessageInfoMapper {
	
	
	/**
	 * 插入推送消息记录
	 * @param pushMessageInfo
	 * @return
	 */
	public int insertPushMessage(PushMessageInfo pushMessageInfo);
	
	
	
	/**
	 * 批量插入消息记录
	 * @param list
	 * @return
	 */
	public int insertPushMessageBath(List<PushMessageInfo> list);
	
	
	
	/**
	 * 查询需要推送消息的列表
	 * @return
	 */
	public List<PushMessageInfo> selectPushMessageList();
	
	
	/**
	 * 更新推送信息
	 * @return
	 */
	public int updatePushMessage(PushMessageInfo pushMessageInfo);
	
	
	/**
	 * 查询用户大类下第一条信息
	 * @param userId
	 * @param categoryCode
	 * @return
	 */
	public PushMessageInfo  selectPushMessageInfo(@Param("userId") String userId,@Param("categoryCode") String categoryCode);
	
	
	
	/**
	 * 统计用户大类未读消息条数
	 * @param userId
	 * @param categoryCode
	 * @return
	 */
	public int  countPushMessageInfoUnRead(@Param("userId") String userId,@Param("categoryCode") String categoryCode);
	
	
	
	/**
	 * 查询用户大类下未读的第一条信息
	 * @param userId
	 * @param categoryCode
	 * @return
	 */
	public PushMessageInfo  selectPushMessageInfoUnRead(@Param("userId") String userId,@Param("categoryCode") String categoryCode);
	
	
	
	
	
	/**
	 * 消息分页
	 * @param messageInfoPageConditionDto
	 * @return
	 */
	public List<PushMessageInfo> pushMessageInfoPage(MessageInfoPageConditionDto messageInfoPageConditionDto);
	
	
	/**
	 * 查询用户所有消息条数
	 * @param userId
	 * @return
	 */
	public int countAllMessageInfo(@Param("userId") String userId);
	
	
	/**
	 * 更新消息已读未读状态
	 * @param messageIdList
	 * @return
	 */
	public int updateMessageReadStatus(@Param("messageId") String messageId);
	
	
	/**
	 * 批量删除消息
	 * @param messageIdList
	 * @return
	 */
	public int deleteMessageBatch(@Param("userId") String userId);
}
